package project_part2;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

public class GenerateTestCases {

	static final int FN_BIT = 128;
	static final int MB_BIT = 64;
	static final int LN_BIT = 32;
	static final int DOB_BIT = 16;
	static final int A_BIT = 8;
	static final int W_BIT = 4;
	static final int H_BIT = 2;
	static final int G_BIT = 1;
	
	int fields_flags = 0;
	int crit_flags = 0;
	int threshold = 0;
	
	
	static final String[] FN = {"T","F"};
	static final String[] MN = {"T","F"};
	static final String[] LN = {"T","F"};
	static final String[] DOB = {"10/10/2001","10/10/2007"};
	static short[] A = {100,200};
	static short[] W = {100,200};
	static ContactHeight[] H = {new ContactHeight(6,6),new ContactHeight(5,5)};
	static Gender[] G = {Gender.MALE,Gender.FEMALE};
	
	
	public void printSetup(){
		
		

	}
	
	
	/*testFindMatchesThreshCrit()
	{
		
		
	}
	*/
	
	public static void main(String args[]) {

	//criter
		for (int i = 1; i < 16; i++) {
			//cons
			for (int j = 0;j < 16;j++) {
				//thresh
				for (int k = 0; k < 4; k++) {

					System.out.println("@Test\n"+
					"public void test"+"Crit"+i+"Con"+j+"Thresh"+(k+1)+"() {\n"+

						"int score_base = 0;\n"+
						"int outcome = 0;\n"+
						"ContactList clist = new ContactList();\n"+
						"Contact con = setContact("+j+");\n"+
						"Contact res[] = null;\n"+
						"MatchCriteria mc = setCriteria("+i+",true);\n"+
						"score_base = sumBits("+i+"&" + j+");\n"+
						"if (score_base >="+ (k+1)+")\n"+
							"outcome = 1;\n"+
						"clist.add(con);\n"+
						"res = clist.findMatches(con, mc, "+(k+1)+");\n"+
						"System.out.println(\"********\"   );\n"+
						"System.out.println(con);\n"+
						"System.out.println(mc);\n"+
						"System.out.println(outcome+\" \"  +res.length);\n"+
						"System.out.println(\"--------\"   );\n"+
						"assertEquals(outcome,res.length);\n"+
					"}");
			
				}
				}

			}
		}

	
	
	
	public int sumCrit(int value)
	{
		value = value & 15;
		int total = 0;
		
		if((1 & value) == 1)
			total++;
		
		for(int i=0;i<3;i++){
			value = value >> 1;
			
			if((1 & value) == 1)
				total++;
		
		}
		
		return total;
	}
	
	public int sumContact(int value)
	{
		value = value & 255;
		int total = 0;
		
		if((1&value) == 1)
			total++;
		
		for(int i=0;i<7;i++){
			value = value >> 1;
		
			if((1 & value) == 1)
				total++;
		
			
		}
		
		return total;
	}
}
